package com.ruoyi.depot.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.ruoyi.commodity.domain.vo.ProductVO;
import com.ruoyi.depot.domain.WalmartStockPlan;
import com.ruoyi.depot.domain.WalmartStockPlanPackingList;
import com.ruoyi.sale.domain.Plan;
import com.ruoyi.walmart.domain.shipments.dto.ShipmentStockFilters;

/**
 * walmart备货计划Service接口
 * 
 * @author ruoyi
 * @date 2025-02-26
 */
public interface IWalmartStockPlanService 
{
    /**
     * 查询walmart备货计划
     *
     * @param stockId walmart备货计划主键
     * @return walmart备货计划
     */
    public WalmartStockPlan selectWalmartStockPlanByStockId(String stockId);

    /**
     * 查询walmart备货计划列表
     * 
     * @param walmartStockPlan walmart备货计划
     * @return walmart备货计划集合
     */
    public List<WalmartStockPlan> selectWalmartStockPlanList(WalmartStockPlan walmartStockPlan);

    /**
     * 新增walmart备货计划
     *
     * @param plan walmart备货计划
     * @return 结果
     */
    public int insertWalmartStockPlan(Plan plan);

    /**
     * 修改walmart备货计划
     * 
     * @param walmartStockPlan walmart备货计划
     * @return 结果
     */
    public int updateWalmartStockPlan(WalmartStockPlan walmartStockPlan);

    /**
     * 批量删除walmart备货计划
     * 
     * @param stockIds 需要删除的walmart备货计划主键集合
     * @return 结果
     */
    public int deleteWalmartStockPlanByStockIds(String[] stockIds);

    /**
     * 删除walmart备货计划信息
     * 
     * @param stockId walmart备货计划主键
     * @return 结果
     */
    public int deleteWalmartStockPlanByStockId(String stockId);

    /**
     * 导入装箱清单
     * @param planPackingLists
     * @return
     */
	int importExcel(List<WalmartStockPlanPackingList> planPackingLists);

    /**
     * 查询可选的备货计划sku数据
     *
     * @param stockId
     * @return
     */
    Set<String> selectSku(String stockId);
    /**
     * 设置walmart备货计划关联ID
     * @return
     */
    int setWalmartStockPlanShipmentId(String shipmentId, String stockId);

    /**
     * 获取walmart备货计划导入的备货清单信息
     */
    List<WalmartStockPlanPackingList> getImportedPlan(String stockId);

    /**
     * 备货计划发货
     * @param stockIds
     * @return
     */
    int shippingStockPlan(String[] stockIds);

    /**
     * 导入备货清单运费
     * @param planPackingLists
     * @return
     */
    int importFreight(List<WalmartStockPlanPackingList> planPackingLists, BigDecimal totalAmount,int calculationMode);
    /**
     * 取消关联的备货计划的发货shipmentId
     * @param shipmentId
     * @return
     */
    int updateWalmartStockPlanShipmentId(String shipmentId);
    /**
     * 查询指定 authId 下所有非空的 shipment_id（去重）
     */
    List<String> selectDistinctShipmentIdsByAuthId(Long authId);
    /**
     * 已取消的walmart入库单，清空备货计划的shipment_id
     */
    int  clearShipmentIdBatch(List<String> cancelledIds);

    /**
     * 获取walmart备货计划GTIN相关信息
     * @param stockId
     * @return
     */
    Map<String, ProductVO> selectGTIN(String stockId);

    /**
     * 修改物流公司
     * @param walmartStockPlan
     * @return
     */
    int updateStockPlanLogistics(WalmartStockPlan walmartStockPlan);

    /**
     * 修改体积计算模式
     * @param walmartStockPlan
     * @return
     */
    int updateStockPlanVolumeMode(WalmartStockPlan walmartStockPlan);
    /**
     * 手动绑定备货计划
     * @param ShipmentStockFilters
     * @return
     */
    void bingShipmentStock(ShipmentStockFilters ShipmentStockFilters);
    /**
     * 取消绑定备货计划
     * @param shipmentId
     * @return
     */
    void cancelShipmentStock(String shipmentId);

    /**
     * 修改快递单号
     * @param walmartStockPlan
     * @return
     */
    int updateStockTrackingNumber(WalmartStockPlan walmartStockPlan);
}
